<template>
  <div class="swiper">
    <swiper :options="swiperOption" v-if="swiperList.length">
      <!-- slides -->
      <swiper-slide v-for="item in swiperList" :key="item.id">
        <img class="swipe-img" :src="item.imgUrl">
      </swiper-slide>
      <!-- Optional controls -->
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>
<script>
export default {
  props: ["swiperList"],
  data() {
    return {
      swiperOption: {
        loop: true,
        pagination: {
          el: ".swiper-pagination"
        }
      }
    };
  }
};
</script>
<style lang="stylus" scoped>
.swiper
  background-color #666
  width 100%
  height 2rem

.swiper img
  width 100%
  height 2rem

.swiper >>> .swiper-pagination-bullet-active
  background #fff
</style>


